# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=stellarium
pkgver=24.1
pkgrel=1
pkgdesc="A stellarium with great graphics and a nice database of sky-objects"
url="https://stellarium.org/"
# gigantic package
arch="aarch64 x86_64"
license="GPL-2.0-or-later"
makedepends="
	boost-dev
	cmake
	freetype-dev
	gpsd-dev
	libpng-dev
	mesa-dev
	openssl-dev>3
	qt5-qtcharts-dev
	qt5-qtlocation-dev
	qt5-qtmultimedia-dev
	qt5-qtscript-dev
	qt5-qtserialport-dev
	qt5-qttools-dev
	samurai
	"
subpackages="$pkgname-doc"
source="https://github.com/Stellarium/stellarium/releases/download/v$pkgver/stellarium-$pkgver.tar.xz"

build() {
	# SHOWMYSKY support needs qt5-qtopengl
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DENABLE_TESTING=1 \
		-DENABLE_SHOWMYSKY=OFF
	cmake --build build
}

check() {
	# Exclude a broken locale test
	ctest --test-dir build --output-on-failure \
		-E 'test(INDIConnection|TelescopeControl_INDI|TelescopeClientINDI)'
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
60e0e2afb214f4e2d9ba6640f4b699d18c97b05b9f33e9990787a87484c6bd1d7bc87685558956e6dc8a80e93abd8d7f677daeb55d38d8f4f8448e7936999246  stellarium-24.1.tar.xz
"
